import java.util.Scanner;

public class Test {
    public static int Sum(int x,int y) {
        return x+y;
    }
    public static double Sum(double x,double y) {
        return x+y;
    }
    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        double c = 3.1;
        double d = 4.2;
        int ret1 = Sum(a,b);
        double ret2 = Sum(c,d);
        System.out.println(ret1);
        System.out.println(ret2);
    }
    public static void print(int x,int y) {
        int sum = x+y;
        System.out.println(sum);
    }
    public static void main10(String[] args) {
        int a= 10;
        int b= 20;
        print(a,b);
    }
    public static int add(int x,int y) {
        return x+y;
    }
    public static void main9(String[] args) {
        int ret = add(2,3);
        System.out.println(ret);
    }
    public static void Swap(int x,int y) {
        int tmp = x;
        x = y;
        y = tmp;
        System.out.println("Swap方法中:");
        System.out.println("x="+x);
        System.out.println("y="+y);
    }
    public static void main8(String[] args) {
        int a = 10;
        int b = 20;
        Swap(a,b);
        System.out.println("main方法中:");
        System.out.println("a="+a);
        System.out.println("b="+b);
    }
    public static void main7(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入一个数:");
        int num = sc.nextInt();
        int sum = 1;
        for (int i = 1; i <= num ; i++) {
            sum *= i;
        }
        System.out.println(num+"的阶乘为:"+sum);
    }


    public static int sum(int x, int y) {
        return x+y;
    }
    public static double sum(double x,double y) {
        return x+y;
    }
    public static void main5(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入两个整数:");
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        System.out.print("请输入两个小数:");
        double num3=sc.nextDouble();
        double num4=sc.nextDouble();
        System.out.println("两整数之和为:"+(num1+num2));
        System.out.println("两小数之和为:"+(num3+num4));
    }
    public static int leiJia(int n) {
        int s = 1;
        for (int i = 1; i <= n; i++) {
            s *= i;
        }
        return s;
    }
    public static void main4(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入一个整数:");
        int num = sc.nextInt();
        int sum = 0;
        for (int i = 1; i <= num; i++) {
            sum += leiJia(i);
        }
        System.out.println(sum);
    }
    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入一个整数:");
        int N = sc.nextInt();
        int Sum = 1;
        for (int i = 1; i <=N; i++) {
            Sum *= i;
        }
        System.out.println(N+"的阶乘为:"+Sum);
    }
    public static int max2(int x,int y) {
        return x>y?x:y;
    }
    public static int max3(int x,int y,int z) {
        int ret=max2(x,y);
        return ret>z?ret:z;
    }
    public static void main2(String[] args) {
        System.out.println(max2(5, 2));
        System.out.println(max3(5, 2, 10));
    }
    public static void main1(String[] args) {
        int sum = 0;
        int flag = -1;
        for (int i = 1; i <101 ; i++) {
            flag = -flag;
            sum += flag/i;
        }
        System.out.println(sum);
    }
}
